<!-- 全部公告页面 -->
<!-- 小默子 2020/9/2更新 -->
<template>
	<view>
		<!-- <NoticeSummary 
			v-for="(item,index) in summaryList"
			:key='index'
			:summaryData='item'>
			
		</NoticeSummary> -->
		<view>
			<NoticeListSummary v-for="(item,index) in summaryList" :key="index" :datas="item" @refreshPage="refreshPage" :role="role"></NoticeListSummary>
		</view>
	</view>
</template>

<script>
	import {_ajax} from '../../in-xupt-functions.js'
	import NoticeListSummary from '../../components/summary/NoticeListSummary.vue'
	export default {
		data() {
			return {
				summaryList: [], // 公告列表
				role: 1, //成员权限
				communityid: 0, // 圈子的id
			}
		},
		methods: {
			// 加载公告列表
			refreshPage: function () {
				this.summaryList = [];
				this.loadNoticeList();
			},
			loadNoticeList() {
				let _self = this
				uni.showLoading({
					title:'正在加载',
					mask: true
				})
				_ajax({
					url: '/circle/' + _self.communityid + '/announcements/',
					method: 'GET'
				}).then(res => {
					this.summaryList = res.data.data
					uni.hideLoading()
				})
			}
		},
		components: {
			NoticeListSummary,
		},
		onLoad: function(options){
			this.communityid = options.communityId
			this.role = options.role
			this.loadNoticeList()
		}
	}
</script>

<style>

</style>

